import 'package:flutter_test/flutter_test.dart';
import 'package:game/game.dart';
import 'package:game/game_platform_interface.dart';
import 'package:game/game_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockGamePlatform
    with MockPlatformInterfaceMixin
    implements GamePlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final GamePlatform initialPlatform = GamePlatform.instance;

  test('$MethodChannelGame is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelGame>());
  });

  test('getPlatformVersion', () async {
    Game gamePlugin = Game();
    MockGamePlatform fakePlatform = MockGamePlatform();
    GamePlatform.instance = fakePlatform;

    expect(await gamePlugin.getPlatformVersion(), '42');
  });
}
